home *** CD-ROM | disk | FTP | other *** search
- Path: engnews1.Eng.Sun.COM!taumet!clamage
- From: James Kanze US/ESC 60/3/141 #40763 <kanze@lts.sel.alcatel.de>
- Newsgroups: comp.std.c++
- Subject: Re: Q: default constructor for fundamental types?
- Date: 27 Feb 1996 16:01:12 GMT
- Organization: ?
- Approved: clamage@eng.sun.com (comp.std.c++)
- Message-ID: <9602271131.AA18225@lts.sel.alcatel.de>
- References: <4glrdc$dqo@ra.ibr.cs.tu-bs.de> <4gsvhn$csi@clarknet.clark.net>
- NNTP-Posting-Host: taumet.eng.sun.com
- Content-Type: text
- In-Reply-To: gusty@clark.net's message of 26 Feb 1996 20:13:44 GMT
- Content-Length: 1310
- X-Lines: 34
- Originator: clamage@taumet
-
- In article <4gsvhn$csi@clarknet.clark.net> gusty@clark.net (Harlan
- Messinger) writes:
-
- |> Dirk Herrmann (dirk@sallust.ida.ing.tu-bs.de) wrote:
- |> : Sorry if this has been discussed before.
- |> :
- |> : When using templates, it appears that there should be
- |> : default constructors for the fundamental data types.
-
- |> Essentially, there is.
-
- [Example deleted...]
-
- |> But it appears that it is allowed. It works fine in Visual C++ 2.2.
- [...]
-
- |> The following produces output of "8" on the first line and gobbledygook
- |> on the second line, since the effect of the "default constructor" of the
- |> integer member function is to do nothing.
-
- This is wrong, but since it is a recent change, it is probable that
- the compiler simply hasn't implemented it yet.
-
- Expressions of the form `int()' have always been allowed. A (fairly)
- recent change to the draft standard states that they have the same
- value as default static initialization (in this case, 0). The earlier
- rules had the initailization undefined.
-
- --
- James Kanze Tel.: (+33) 88 14 49 00 email: kanze@gabi-soft.fr
- GABI Software, Sarl., 8 rue des Francs-Bourgeois, F-67000 Strasbourg, France
- Conseils, Θtudes et rΘalisations en logiciel orientΘ objet --
- -- A la recherche d'une activitΘ dans une region francophone
-
-
-
- [ comp.std.c++ is moderated. To submit articles: Try just posting with your
- newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
- comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
- Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
- Comments? mailto:std-c++-request@ncar.ucar.edu
- ]
-